
import { checkCreatSiteForm } from "./formRuler";
// isBoolean:true, // 是否为Boolean类型, 参数是否必须为boolen类型，不是根据options个数判断，是根据后台字段类型要求判断
const sysSettingForm = {
  ipCtlType: 1,
  autoInterceptEnable: false,
  accessWeek: [],
  accessHour: [],
  domainBlacklist: '',
  invalidHour: '',
  ipWhitelist: '',
  ipPrams: undefined,
  formState: [
    {
      value: '内网IP拦截设置',
      type: 'title',
      children: [
        {
          value: [],
          placeholder: '请输入域名',
          param: 'domainBlacklist',
          rule: {
            required: false,
            validator: checkCreatSiteForm,
            trigger: ["blur", 'change'],
            message: '限制域名不能为空！',
            key: 'siteDomain',
          },
          label: "限制访问域名:",
          beforeText: '',
          afterText: '',
          extra: '输入框中的域名将不可访问后台， 多个域名用回车键隔开',
          marginLeft: 32,
          type: 'textArea',
          tips: '',
        },
        {
          value: 1,
          param: 'ipCtlType',
          rule: {
            required: false,
            validator: checkCreatSiteForm,
            trigger: ["blur"],
            msg1: '',
            message: '',
          },
          label: "防火墙类型设置:",
          type: 'radio',
          isBoolean: false, // 是否为Boolean类型
          options: ['不限制', '白名单', '黑名单'],
          tips: '',
        },
        {
          value: 1,
          placeholder: '请选择IP',
          param: 'ipPrams',
          rule: {
            required: true,
            validator: checkCreatSiteForm,
            trigger: ["blur"],
            msg1: '请选择IP！',
            msg2: '请选择IP！',
            api: "",
            key: 'siteDomain',
            params: {}, //校验传参
          },
          label: "白名单IP设置:",
          beforeText: '',
          afterText: '',
          marginLeft: 32,
          type: 'multipleSelect',
          addItem: true,
          showTable: true,
          options: [
            192.168,
            172,
            10
          ],
          mode: 'single',
          associated: 'ipCtlType',
          associatedValue: 2,
        },
        {
          value: 1,
          placeholder: '请选择IP',
          param: 'ipPrams',
          rule: {
            required: true,
            validator: checkCreatSiteForm,
            trigger: ["blur"],
            msg1: '请选择IP！',
            msg2: '',
            api: "",
            key: 'siteDomain',
            params: {}, //校验传参
          },
          label: "黑名单IP设置:",
          beforeText: '',
          afterText: '',
          marginLeft: 32,
          type: 'multipleSelect',
          addItem: true,
          showTable: true,
          options: [
            192.168,
            172,
            10
          ],
          mode: 'single',
          associated: 'ipCtlType',
          associatedValue: 3,
        }
      ]
    },

    {
      value: '后台可允许登录时间设置',
      type: 'title',
      children: [
        {
          value: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23],
          placeholder: '请选择',
          param: 'accessHour',
          rule: {
            required: false,
            validator: checkCreatSiteForm,
            trigger: ["blur"],
            msg1: '1111',
            msg2: '',
            api: "",
            key: 'siteDomain',
            params: {}, //校验传参
          },
          label: "允许登录后台的时间段:",
          beforeText: '',
          afterText: '',
          marginLeft: 32,
          showCheckAll: true,
          type: 'checkbox-group',
          checkboxOptions: [{ label: '0点', value: 0 },
          { label: '1点', value: 1 }, { label: '2点', value: 2 }, { label: '3点', value: 3 }, { label: '4点', value: 4 }, { label: '5点', value: 5 }, { label: '6点', value: 6 }, { label: '7点', value: 7 }, { label: '8点', value: 8 }, { label: '9点', value: 9 }, { label: '10点', value: 10 }, { label: '11点', value: 11 }, { label: '12点', value: 12 }, { label: '13点', value: 13 }, { label: '14点', value: 14 }, { label: '15点', value: 15 }, { label: '16点', value: 16 }, { label: '17点', value: 17 }, { label: '18点', value: 18 }, { label: '19点', value: 19 }, { label: '20点', value: 20 }, { label: '21点', value: 21 }, { label: '22点', value: 22 }, { label: '23点', value: 23 },],
          mode: '',
          associated: '',
          associatedValue: '',
        },
        {
          value: [1, 2, 3, 4, 5, 6, 7],
          placeholder: '请选择',
          param: 'accessWeek',
          rule: {
            required: true,
            validator: checkCreatSiteForm,
            trigger: ["blur"],
            message: '星期选择不能空！',
            key: 'siteDomain',
            params: {}, //校验传参
          },
          label: "允许登录后台的星期:",
          beforeText: '',
          afterText: '',
          marginLeft: 32,
          type: 'multipleSelect',
          options: [{ label: '一', value: 1 }, { label: '二', value: 2 }, { label: '三', value: 3 }, { label: '四', value: 4 }, { label: '五', value: 5 }, { label: '六', value: 6 }, { label: '日', value: 7 },],
          mode: 'multiple',
          associated: '',
          associatedValue: '',
        }
      ]
    },

    {
      value: '智能IP拦截',
      type: 'title',
      children: [
        
        {
          value: '',
          placeholder: '',
          param: 'autoInterceptEnable',
          rule: {
            required: false,
            validator: checkCreatSiteForm,
            trigger: ["blur"],
            msg1: '',
            msg2: '',
            api: "",
            key: 'siteDomain',
            params: {}, //校验传参
          },
          label: "是否开启智能黑名单IP拦截:",
          beforeText: '',
          afterText: '',
          type: 'switch',
          size: 'small',
          associated: '',
          associatedValue: '',
          tips: ''
        },
        {
          value: '',
          placeholder: '',
          precision: 0,
          param: 'invalidHour',
          rule: {
            required: true,
            validator: checkCreatSiteForm,
            trigger: ["blur"],
            msg1: '此项必传',
            msg2: '',
            api: "",
            key: 'siteDomain',
            params: {}, //校验传参
          },
          label: "",
          beforeText: '系统将智能识别有风险的外网IP，将风险IP进行管控，对应IP在',
          afterText: '小时内不可进入后台管理系统，可以手动移除IP解除封禁。',
          type: 'numberInput',
          associated: 'autoInterceptEnable',
          associatedValue: true,
          tips: ''
        },

      ]
    },
  ]
}
export { sysSettingForm }